/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Data;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author saleem
 */
@Entity
@Table(name = "labtest")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Labtest.findAll", query = "SELECT l FROM Labtest l"),
    @NamedQuery(name = "Labtest.findByTid", query = "SELECT l FROM Labtest l WHERE l.tid = :tid"),
    @NamedQuery(name = "Labtest.findByName", query = "SELECT l FROM Labtest l WHERE l.name = :name"),
    @NamedQuery(name = "Labtest.findByDescription", query = "SELECT l FROM Labtest l WHERE l.description = :description")})
public class Labtest implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "TID")
    private Integer tid;
    @Size(max = 50)
    @Column(name = "Name")
    private String name;
    @Size(max = 500)
    @Column(name = "Description")
    private String description;

    public Labtest() {
    }

    public Labtest(Integer tid) {
        this.tid = tid;
    }

    public Integer getTid() {
        return tid;
    }

    public void setTid(Integer tid) {
        this.tid = tid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tid != null ? tid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Labtest)) {
            return false;
        }
        Labtest other = (Labtest) object;
        if ((this.tid == null && other.tid != null) || (this.tid != null && !this.tid.equals(other.tid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Data.Labtest[ tid=" + tid + " ]";
    }
    
}
